package com.xiaoyilin.topic;

/**
 * 创建Topic
 */
public class TopicCommand {

    public static void create() {
        String[] options = new String[]{
                "--zookeeper ",
                "localhost:2181 ",
                "--create",
                "--replication factor",
                "1",
                "--partitions",
                "1",
                "--topic",
                "topic-create-api",
        };
        kafka.admin.TopicCommand.main(options);
    }

    public static void describeTopic() {
        String[] options = new String[]{
                "--zookeeper ",
                "localhost:2181 ",
                "--describe",
                "--topic",
                "topic-create-api",
        };
        kafka.admin.TopicCommand.main(options);
    }

    public static void main(String[] args) {
        create();
        describeTopic();
    }


}
